1. Field of the Invention
The present invention relates to the recovery of data. More particularly, the present invention relates to the recovery of lost/damaged block data in a bitstream of compressed data.
2. Art Background
It is often desirable to compress data, such as video images or sound data, for transmission and storage. Typically, when data is compressed, compression constants are generated. In some instances block-wide data is generated. These constants are transmitted or stored along with the compressed image. Problems can arise if the compression constants are lost or damaged prior to decompression of the data. As an illustration, the discussion below illustrates the problems that arise if image data compression constants are lost.
The discrete data points that make up a digital image are known as pixels. For example, each pixel is represented independently using 8 bits, but other representations also are used for the purposes of compression analysis. Most of the alternative representations begin by dividing this raw data into disjoint sets. For historical reasons, these sets are referred to as xe2x80x9cblocksxe2x80x9d, even though they may not have a traditional block shape. The alternative representation then characterizes the data by some block-wide information and per-pixel information.
Examples of block-wide information include the minimum pixel value (MIN), the maximum pixel value (MAX), and the dynamic range of the pixel values (DR), where DR=MAXxe2x88x92MIN or DR=1+MAXxe2x88x92MIN. Per-pixel information may indicate where the pixel value lies within the range specified by the global information. For compression to be achieved, the per-pixel information must use only a few bits of storage so that the total number of bits used is less than that required to store the raw image.
In one example, the block data is comprised of the MIN, DR and Qbit number (defined below), and the pixel data is comprised of Q codes. A Q code is a Qbit number that corresponds to one value in the set {MIN, MIN+1, . . . , MAX). Since the Qbit number is generally small and the DR value may be relatively large, it is generally not possible to represent all pixel values exactly. Therefore, some quantization error is introduced when pixel values are reduced to Q code values. For instance, if the Qbit number is 3, then it is generally possible to represent 23=8 values from the set {MIN, MIN+1, . . . , MAX} without any error. Pixels with other values are rounded to one of these eight values. This rounding introduces quantization error.
If any of the block information, e.g., MIN, MAX or DR, is lost, the damage to the image is potentially large as many pixels are affected. For this reason, it is desirable to have techniques for accurately estimating or recovering the values of this lost data.
A method and apparatus for hardware efficient decoding of compression coefficients. In one embodiment, a numerator of an equation used to compute a compression coefficient is computed. The denominator is also computed. The numerator and denominator values are truncated such that each numerator and denominator are equal in length to a predetermined constant K. A K-bit integer division is then executed to determine the value of the compression constant.